/**
 * User: zhangqiang
 * Date: 15-8-11
 * Time: 上午11:04
 * 查询面板
 */

define(["require",
		"dojo/_base/declare",
		"dojo/_base/lang",
		"dojo/_base/array",
		"dojo/_base/fx",
		"dojo/fx/easing",
		"../../util/ajaxUtil",
		"dojo/dom",
		"dojo/dom-attr",
		"dojo/dom-class",
		"dojo/dom-style",
		"dojo/on",
		"dojo/query",
		"dojo/topic",
		"../BaseWidget",
		"gistech/widgets/LandManageAndControlReportWidget/LandManageAndControlReportWidget",
		 "gistech/widgets/drawGeometryWidget/DrawGeometryWidget",
		"gistech/widgets/SpecialDataReportWidget/SpecialDataReportWidget",
		"dijit/layout/ContentPane",
        "gistech/widgets/MapLayerResourceWidget/MapLayerResourceWidget",
		"dojo/text!./templates/Template.html"],
    function (require, declare, lang, array, baseFx,easing,ajaxUtil, dom, domAttr, domClass, domStyle, on, query, topic, 
    		BaseWidget,LandManageAndControlReportWidget,DrawGeometryWidget,SpecialDataReportWidget,ContentPane,MapLayerResourceWidget, template) {
        return declare([BaseWidget], {
            templateString: template,
            map: null,
            ismove:false,//组件位置移动判断
            righttabCon:null,
            lefttabCom:null,
            constructor: function (args) {
                this.map = args.map;
               
            },

            postCreate: function () {
            	this.inherited(arguments);
            	on(this.menu1, "click",lang.hitch(this,this.SelectMenu1));
    			on(this.menu2, "click",lang.hitch(this,this.SelectMenu2));
    			on(this.menu3, "click",lang.hitch(this,this.SelectMenu3));
    			on(this.menu4, "click",lang.hitch(this,this.SelectMenu4));
    			on(this.menu5, "click",lang.hitch(this,this.SelectMenu5));
    			on(this.menu6, "click",lang.hitch(this,this.SelectMenu6));
 
    			on(this.menu8, "click",lang.hitch(this,this.SelectMenu8));//专题统计
 
    			on(this.menu7, "click",lang.hitch(this,this.SelectMenu7));
 
            },

            startup: function () {
                this.inherited(arguments);
                //this.init();
            },

            SelectMenu6:function(){
            	this.righttabCon = dijit.byId("rightTabCon");
            	this.righttabCon.removeAllTab();
            	var LandReportTab = new  ContentPane();

            	LandReportTab.set('content', "<div id='LandReportTab' ></div>");
            	this.righttabCon.addTab(LandReportTab,"",true);
            	
            	this.righttabCon.setWidth();
            	var landr = new LandManageAndControlReportWidget({map:this.map,rightTab:this.righttabCon},dojo.byId("LandReportTab"));
            	landr.startup();
            	
            	this.righttabCon.expandBtn.click();
            },
 
            
            SelectMenu8:function(){
            	this.righttabCon = dijit.byId("rightTabCon");
            	this.righttabCon.removeAllTab();
            	var LandReportTab = new  ContentPane();

            	LandReportTab.set('content', "<div id='SpecialReportTab' ></div>");
            	this.righttabCon.addTab(LandReportTab,"",true);
            	
            	this.righttabCon.setWidth();
            	var landr = new SpecialDataReportWidget({map:this.map,rightTab:this.righttabCon},dojo.byId("SpecialReportTab"));
            	landr.startup();
            	
            	this.righttabCon.expandBtn.click();
            },
            
 
            SelectMenu7:function(){
            	           	
            	var drawGeometryWidget = new DrawGeometryWidget({map:this.map});
                drawGeometryWidget.startup();
            },
 
            init:function(){
            	debugger;
            	this.lefttabCon = dijit.byId("leftTabCon");
            	
            	var ResourceTab = new  ContentPane();

            	ResourceTab.set('content', "<div id='ResourceTab' ></div>");
            	this.lefttabCon.addTab(ResourceTab,"资源列表",true);
            	
            	this.righttabCon.setWidth();
            	var mapLayerResourceWidget = new MapLayerResourceWidget({map:this.map,lefttabCon:this.lefttabCon},dojo.byId("ResourceTab"));
            	mapLayerResourceWidget.startup();
            	
            	var CityTab = new  ContentPane();

            	CityTab.set('content', "<div id='CityTab' ></div>");
            	this.lefttabCon.addTab(CityTab,"城市列表",true);
            	
            	
            },
            destroy: function () {
                var widgets = this.widgets;
                for (var name in widgets) {
                    if (widgets[name]) {
                        widgets[name].destroy();
                    }
                }
                this.inherited(arguments);
            },
      
        });
    });